package com.xiaochong.tir.manager.service;

import com.xiaochong.tir.common.data.mapper.NonListedCompanyIndexMapper;
import com.xiaochong.tir.common.data.po.ListedCompanyIndex;
import com.xiaochong.tir.common.data.po.NonListedCompanyIndex;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 此类为[基础代码]自动生成,已经拥有基本的增删改成操作
 * <其他请自行扩展>
 * @author cx
 * @time 2018-04-26 09:56
 *
 */
@Service
public class WBlockIndexService {

    @Autowired
    private NonListedCompanyIndexMapper nonCompanyIndexMapper;

	/**
     * 新增
     * @param entity
     * @param session
     */
    public int insertSelective (NonListedCompanyIndex entity) {
     return this.nonCompanyIndexMapper.insertSelective(entity);
    }

    /**
     * 批量新增
     * @param list
     * @param session
     */
    public void insertBatch(List<NonListedCompanyIndex> list) {

          this.nonCompanyIndexMapper.insertBatch(list);

    }

    /**
     * 根据主键修改单条数据
     * @param entity
     * @param session
     */
    public int updateByPrimaryKey(NonListedCompanyIndex entity) {
           return this.nonCompanyIndexMapper.updateByPrimaryKey(entity);
    }

    /**
     * 根据主键批量修改数据
     * @param list
     * @param session
     */
    public void updateBatch(List<NonListedCompanyIndex> list) {

          this.nonCompanyIndexMapper.updateBatch(list);
    }

    /**
     * 根据主键查询单条数据
     * @param id
     */
    public ListedCompanyIndex selectByPrimaryKey(Integer id) {
            return this.nonCompanyIndexMapper.selectByPrimaryKey(id);
    }

    /**
     * 根据条件查询Id
     * @param entity
     */
    public Integer selectById(NonListedCompanyIndex entity) {
           return  this.nonCompanyIndexMapper.selectById(entity);
    }

     /**
     * 根据条件查询Ids
     * @param entity
     */
    public List<Integer> selectByIds(NonListedCompanyIndex entity) {
        return  this.nonCompanyIndexMapper.selectByIds(entity);
    }

     /**
     * 根据主键删除单条记录
     * @param id
     */
    public void deleteByPrimaryKey(Integer id) {
           this.nonCompanyIndexMapper.deleteByPrimaryKey(id);
    }

    /**
     * 根据主键删除多条记录
     * @param list
     */
    public void deleteBatch(List<Integer> list) {
           this.nonCompanyIndexMapper.deleteBatch(list);
    }

     /**
     * 根据某些条件删除
     * @param entity
     */
    public void deleteBatch(NonListedCompanyIndex entity) {
           this.nonCompanyIndexMapper.deleteByEntity(entity);
    }


    /**
     * 根据条件查询多条记录
     * @param entity
     */
    public List<NonListedCompanyIndex> selectByEntityList(NonListedCompanyIndex entity) {
        return this.nonCompanyIndexMapper.selectByEntityList(entity);
    }

}